<?php
	require_once('session_handler.php');
    session_handler_start();
	
	require_once("webservices.php");

	print_r($_POST);
	CreateNewTest();
	
	//exit();
	
	if($_GET["test_func"] == "create")
	{
		
		$test_id = md5("hai");
		$_SESSION['test_data'] = $_POST;
		$_SESSION['test_data']['test_id'] = $test_id;
		//echo "<pre>".print_r($_POST)."</pre>";
		header("Location: QuestionsAndTests.php?test_id=$test_id");
	}
	
	function CreateNewTest()
	{
		$CourseID  = $_POST['classes_list'];
		$TestName  = $_POST['test-name'];
		$Descript  = "";
		$Vis       = 1;
		$StartTime = $_POST['test_start_date'];
		$EndTime   = $_POST['test_end_date']; 
		$AutoGrade = 1; 
		$MaxPts    = empty($_POST['num-points']) ? 0 : $_POST['num-points']; 
		$GivenTime = $_POST['test-limit'];
		$ThePledge = "No exceptions!";
		
		Create_test($CourseID, $TestName, $Descript, $Vis, $StartTime,
					$EndTime, $AutoGrade, $MaxPts, $GivenTime, $ThePledge);
					
		
	}
?>